
class P10924_39643 {

	static int numberofprimes = 1000000;

	static boolean[] primesBoolean = new boolean[numberofprimes];
	
	
	static void createPrimes() {
		int i, j;

//		for (i = 0; i < numberofprimes; i++) {
//			primesBoolean[i] = false;
//		}
		primesBoolean[1] = true;
		primesBoolean[2] = true;
		primesBoolean[3] = true;

		for (i = 5; i < numberofprimes; i += 2) {
			for (j = 3; j * j <= i; j += 2)
				if (i % j == 0)
					break;
			if (i % j != 0) {
				primesBoolean[i] = true;
			}
		}
	}

	
	public static void main(String[] args) {
		
		createPrimes();
		
		String line = readLn();
		
		while (line != null) {
			process(line);
			line = readLn();
		}
		
	}
	
	private static void process(String line) {
		
		int number = 0;
		
		for (int k = 0; k < line.length(); k++) {
			char c = line.charAt(k);

			if (c >= 'a' && c <= 'z') {
				number += (int)(c - 'a') + 1;
			} else {
				number += (int)(c - 'A') + 27;
			}
		}
		
		if (primesBoolean[number]) {
			System.out.println("It is a prime word.");
		} else {
			System.out.println("It is not a prime word.");
		}
		
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

	
}
